package com.yang.qgg_demo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yang.qgg_demo.entity.Bill;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface BillMapper extends BaseMapper<Bill> {
    @Select("SELECT date, SUM(money) AS total_money FROM bill GROUP BY date ORDER BY date")
    List<Map<String, Object>> findTotalMoneyByDate();

    @Select("SELECT SUM(money) AS total_money FROM bill")
    Integer findTotalMoney();

    @Select("SELECT SUM(profit) AS total_money FROM bill")
    Integer findprofit();

}
